<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="common/head :: htmlhead">
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">待审核博物馆</div>
                <div class="layui-card-body">
                    <div class="table-reload-btn" style="margin-bottom: 10px;">
                        搜索：
                        <div class="layui-inline">
                            <input class="layui-input" name="title" id="title" placeholder="博物馆名称" autocomplete="off">
                        </div>
                        <button class="layui-btn" data-type="reload">搜索</button>
                    </div>
                    <table id="demo" lay-filter="demo" style="margin-left: 15px"></table>
                    <script type="text/html" id="table_operate">
                        <a class="layui-btn layui-btn-xs" lay-event="more">详情</a>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['table', 'element', 'form'], function () {
        var table = layui.table
            , element = layui.element
            , form = layui.form;
        //第一个实例
        table.render({
            elem: '#demo'
            , url: '/museumList?status=dsh' //数据接口
            , method: 'post'
            , toolbar: '#table_toolbar'
            , defaultToolbar: ['filter', 'print']
            , cellMinWidth: 80
            , page: true //开启分页
            , cols: [
                [ //表头
                    {type: 'checkbox', fixed: 'left'}
                    , {field: 'id', title: 'ID', hide: true, sort: true}
                    , {field: 'name', title: '博物馆名称', width: 300}
                    , {field: 'province', title: '所属省份', sort: true, width: 150}
                    , {field: 'username', title: '操作者', sort: true}
                    , {
                    field: 'addtime',
                    title: '提交时间',
                    sort: true,
                    templet:'<div>{{ layui.util.toDateString(d.creattime, "yyyy-MM-dd") }}</div>'
                }
                    , {field: 'right', title: '操作', toolbar: '#table_operate', width: 80}
                ]
            ]
        });
        table.on('tool(demo)', function (obj) {
            var data = obj.data;
            if (obj.event === 'more') {
                window.location.href = "museum_more/?id=" + data.id;
            }
        });
    });
</script>
</body>
</html>